<?php

namespace App\Http\Middleware;

use Auth, Closure, Redirect, Route;
use Symfony\Component\HttpKernel\Exception\HttpException;

class Supervisor
{
    public function handle($request, Closure $next, $guard = null)
    {
        $user = Auth::guard($guard)->user();

        if($user->type === 0)
            return $next($request);
        
        return abort('403');
    }
}
